package cn.chengpengper.seckill.reservation.application.builder;

import cn.chengpengper.seckill.common.builder.SeckillCommonBuilder;
import cn.chengpengper.seckill.common.utils.bean.BeanUtil;
import cn.chengpengper.seckill.reservation.application.command.SeckillReservationUserCommand;
import cn.chengpengper.seckill.reservation.domain.model.entity.SeckillReservationUser;

/**
 * @author chengpeng.hu
 */
public class SeckillReservationUserBuilder extends SeckillCommonBuilder {

    public static SeckillReservationUser toSeckillReservationUser(SeckillReservationUserCommand seckillReservationUserCommand){
        if (seckillReservationUserCommand == null || seckillReservationUserCommand.isEmpty()){
            return null;
        }
        SeckillReservationUser seckillReservationUser = new SeckillReservationUser();
        BeanUtil.copyProperties(seckillReservationUserCommand, seckillReservationUser);
        return seckillReservationUser;
    }

}
